home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / shell / dialog-0.000 / dialog-0 / dialog-0.6c / samples / inputbox < prev    next >
Encoding:
Text File  |  1995-08-07  |  688 b   |  27 lines

  1. #!/bin/sh
  2. DIALOG=${DIALOG=../dialog}
  3.  
  4. $DIALOG --title "INPUT BOX" --clear \
  5.         --inputbox "Hi, this is an input dialog box. You can use \n\
  6. this to ask questions that require the user \n\
  7. to input a string as the answer. You can \n\
  8. input strings of length longer than the \n\
  9. width of the input box, in that case, the \n\
  10. input field will be automatically scrolled. \n\
  11. You can use BACKSPACE to correct errors. \n\n\
  12. Try inputing your name below:" 16 51 2> /tmp/inputbox.tmp.$$
  13.  
  14. retval=$?
  15.  
  16. input=`cat /tmp/inputbox.tmp.$$`
  17. rm -f /tmp/inputbox.tmp.$$
  18.  
  19. case $retval in
  20.   0)
  21.     echo "Input string is '$input'";;
  22.   1)
  23.     echo "Cancel pressed.";;
  24.   255)
  25.     echo "ESC pressed.";;
  26. esac
  27.